import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '员工名称',
    align:"center",
    dataIndex: 'personName'
   },
   {
    title: '员工工号',
    align:"center",
    dataIndex: 'personNo'
   },
   {
    title: '告警时间',
    align:"center",
    dataIndex: 'alarmTime'
   },
   {
    title: '地点',
    align:"center",
    dataIndex: 'place'
   },
   {
    title: '违规内容',
    align:"center",
    dataIndex: 'memo'
   },
   {
    title: '违规图片',
    align:"center",
    dataIndex: 'picture',
    customRender:render.renderImage,
   },
   {
    title: '违规视频',
    align:"center",
    dataIndex: 'video',
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "员工名称",
      field: 'personName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "员工工号",
      field: 'personNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "告警时间",
      field: 'alarmTime',
      component: 'DatePicker',
      componentProps: {
         showTime:true,
         valueFormat: 'YYYY-MM-DD HH:mm:ss'
       },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '员工名称',
    field: 'personName',
    component: 'Input',
  },
  {
    label: '员工工号',
    field: 'personNo',
    component: 'Input',
  },
  {
    label: '告警时间',
    field: 'alarmTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '地点',
    field: 'place',
    component: 'Input',
  },
  {
    label: '违规内容',
    field: 'memo',
    component: 'Input',
  },
  {
    label: '违规图片',
    field: 'picture',
     component: 'JImageUpload',
     componentProps:{
        fileMax: 0
      },
  },
  {
    label: '违规视频',
    field: 'video',
    component: 'JUpload',
    componentProps:{
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  personName: {title: '员工名称',order: 0,view: 'text', type: 'string',},
  personNo: {title: '员工工号',order: 1,view: 'text', type: 'string',},
  alarmTime: {title: '告警时间',order: 2,view: 'datetime', type: 'string',},
  place: {title: '地点',order: 3,view: 'text', type: 'string',},
  memo: {title: '违规内容',order: 4,view: 'text', type: 'string',},
  picture: {title: '违规图片',order: 5,view: 'image', type: 'string',},
  video: {title: '违规视频',order: 6,view: 'file', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}